<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script type="text/javascript" charset="utf-8" src="${ctx}/static/inspinia/js/plugins/ueditor-1.4.3.3/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="${ctx}/static/inspinia/js/plugins/ueditor-1.4.3.3/_examples/editor_api.js"></script>
    <script type="text/javascript" charset="utf-8" src="${ctx}/static/inspinia/js/plugins/ueditor-1.4.3.3/lang/zh-cn/zh-cn.js"></script>
</head>

<body>

<div id="wrapper">
    <div class="gray-bg">
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-content">
                            <form method="get" data-ajax="${ctx}/medical/base/statistic/listBase" action="${ctx}/medical/base/statistic/save" class="form-horizontal" id="resident_form">
                                <div id="region_div" class="form-group" style="display: none;">
                                    <label class="col-sm-2 control-label">街道: </label>
                                    <div class="col-sm-4">
                                        <select id="ll" name="regionId"  class=" form-control" items="${statisticBase.regionId}"  style="width:20%" required>
                                            <option value="">请选择</option>
                                            <c:forEach items="${regions}" var="regions" >
                                                <c:choose>
                                                    <c:when test="${regions.id == statisticBase.regionId}">
                                                        <option value="${regions.id}" selected = "true">${regions.title}</option>
                                                    </c:when>
                                                    <c:otherwise>
                                                        <option value="${regions.id}">${regions.title}</option>
                                                    </c:otherwise>
                                                </c:choose>
                                            </c:forEach>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="ym" class="col-sm-2 control-label">统计时间: </label>
                                    <div class="col-sm-4">
                                        <input readonly="readonly" class="form-control"
                                               id="ym" name="ym" value="${statisticBase.ym}" type="text" />
                                    </div>
                                    <label for="typeFzd" class="col-sm-2 control-label">非重点人群: </label>
                                    <div class="col-sm-4"><input type="number" class="form-control" id="typeFzd" name="typeFzd"
                                                                 value="${statisticBase.typeFzd}"/></div>
                                </div>
                                <div class="form-group">
                                    <label for="keyGroup" class="col-sm-2 control-label">重点人群: </label>
                                    <div class="col-sm-4"><input
                                            type="number" class="form-control" id="keyGroup"
                                            name="keyGroup" value="${statisticBase.keyGroup}"/></div>
                                    <label for="typeYcf" class="col-sm-2 control-label">孕产妇: </label>
                                    <div class="col-sm-4"><input type="number" class="form-control" id="typeYcf" name="typeYcf"
                                                                 value="${statisticBase.typeYcf}"/></div>
                                </div>
                                <div class="form-group">
                                    <label for="typeEt" class="col-sm-2 control-label">0-6岁儿童: </label>
                                    <div class="col-sm-4"><input type="number" class="form-control" id="typeEt" name="typeEt"
                                                                 value="${statisticBase.typeEt}"/></div>
                                    <label for="typeLnr" class="col-sm-2 control-label">65岁以上老年人: </label>
                                    <div class="col-sm-4"><input type="number" class="form-control" id="typeLnr" name="typeLnr"
                                                                 value="${statisticBase.typeLnr}"/></div>
                                </div>
                                <div class="form-group">
                                    <label for="typeGxy" class="col-sm-2 control-label">高血压人群: </label>
                                    <div class="col-sm-4"><input type="number" class="form-control" id="typeGxy" name="typeGxy"
                                                                 value="${statisticBase.typeGxy}"/></div>
                                    <label for="typeTnb" class="col-sm-2 control-label">2型糖尿病患者: </label>
                                    <div class="col-sm-4"><input type="number" class="form-control" id="typeTnb" name="typeTnb"
                                                                 value="${statisticBase.typeTnb}"/></div>
                                </div>
                                <div class="form-group">
                                    <label for="typeJsb" class="col-sm-2 control-label">重性精神疾病患者: </label>
                                    <div class="col-sm-4"><input type="number" class="form-control" id="typeJsb" name="typeJsb"
                                                                 value="${statisticBase.typeJsb}"/></div>
                                    <label for="typeFjh" class="col-sm-2 control-label">肺结核患者: </label>
                                    <div class="col-sm-4"><input type="number" class="form-control" id="typeFjh" name="typeFjh"
                                                                 value="${statisticBase.typeFjh}"/></div>
                                </div>
                                <div class="form-group">
                                    <label for="typeCjr" class="col-sm-2 control-label">残疾人: </label>
                                    <div class="col-sm-4"><input type="number" class="form-control" id="typeCjr" name="typeCjr"
                                                                 value="${statisticBase.typeCjr}"/></div>
                                    <label for="typeTs" class="col-sm-2 control-label">计生特殊家庭: </label>
                                    <div class="col-sm-4"><input type="number" class="form-control" id="typeTs" name="typeTs"
                                                                 value="${statisticBase.typeTs}"/></div>
                                </div>
                                <div class="form-group">
                                    <label for="typeDsr" class="col-sm-2 control-label">农村建档立卡低收入人口: </label>
                                    <div class="col-sm-4"><input type="number" class="form-control" id="typeDsr" name="typeDsr"
                                                                 value="${statisticBase.typeDsr}"/></div>
                                    <label for="typeCzdb" class="col-sm-2 control-label">城镇低保人群: </label>
                                    <div class="col-sm-4"><input type="number" class="form-control" id="typeCzdb" name="typeCzdb"
                                                                 value="${statisticBase.typeCzdb}"/></div>
                                </div>

                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-2">
                                        <button class="btn btn-primary" type="submit" >保 存</button>
                                        <a href="javascript:history.go(-1);" class="btn btn-white ">  取消</a>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="${ctx}/static/inspinia/js/plugins/LD.sot/multiupf/uploadify2/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="${ctx}/static/inspinia/js/plugins/LD.sot/multiupf/uploadify2/swfobject.js"></script>
<script type="text/javascript" src="${ctx}/static/inspinia/js/plugins/LD.sot/multiupf/multiupf.uploadify2.js"></script>
<script>
    (function($){
        $.fn.datepicker.dates['zh-CN'] = {
            days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日"],
            daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六", "周日"],
            daysMin:  ["日", "一", "二", "三", "四", "五", "六", "日"],
            months: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
            monthsShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
            today: "今天",
            suffix: [],
            meridiem: ["上午", "下午"]
        };
    }(jQuery));


    $(document).ready(function () {

        if(${add}){
            $('#region_div').css('display','block');
        }


        showdatepicker();
    });

    function calcTotal() {
        var total = 0;

        $("input[id^='type']").each(function(index, element) {
            var value = $(this).val();
            if (!value) return;
            total += Number(value);
        });

        $('#czrks').val(total);
    }

    function showdatepicker() {
        $('#ym').datepicker({
            format: 'yyyy-mm',
            weekStart: 1,
            autoclose: true,
            forceParse: false,
            language: 'zh-CN',
            startView: 2,
            maxViewMode: 1,
            minViewMode: 1
        });
    }
</script>
</body>
</html>
